package com.rp.goouploader;

import java.util.HashMap;
import java.util.Map;

public class GooForm {

	private Map<String, Object> mapData;

	public GooForm() {
		this.mapData = new HashMap<String, Object>();
	}

	public GooForm(Map<String, Object> map) {
		this.mapData = map;
	}

	public String getNowValue(String key) {
		return String.valueOf(this.mapData.get(key));
	}

	public String getValue(String key) {
		return String.valueOf(this.mapData.get(key)).replaceAll("null", "")
				.replaceAll("\r\n", "<br>").replaceAll("\r", "<br>")
				.replaceAll("\n", "<br>");
	}

	public Object getObject(String key) {
		return this.mapData.get(key);
	}

	public void setValue(String key, String value) {
		this.mapData.put(key, value);
	}

	public void setValue(String key, Object obj) {
		this.mapData.put(key, obj);
	}

	public Map<String, Object> getMapData() {
		return this.mapData;
	}
	
	public void addMapData(Map<String, Object> map) {
		this.mapData.putAll(map);
	}

	public void setMapData(Map<String, Object> map) {
		this.mapData = map;
	}
	
	public void clear() {
		this.mapData = null;
	}

}
